﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace RobotView
{
    public partial class Lamp : UserControl
    {
        private bool state;

        public bool State
        {
            get { return this.state; }
            set {
                this.setState(value); 
            }
        }

        public Lamp()
        {
            InitializeComponent();
            this.setState(false); //start with lamp being off
        }

        private void setState(bool state)
        {
            this.state = state;
            if (state == true)
            {
                picBoxLamp.Image = Resource1.LAMP_ON;
            }
            else
            {
                picBoxLamp.Image = Resource1.LAMP_OFF;
            }
        }

    }
}